﻿$(function () {
    $("#tabs-film").tabs();
    $(".tab-price").tabs();
    $('#now-show').click(function(){
		 $('#movieSlide-now').css({
            'z-index':'1000'
         });
          $('#movieSlide-will').css({
            'z-index':'-1'
          });
    });
    $('#will-show').click(function(){
		 $('#movieSlide-now').css({
            'z-index':'-1'
         });
          $('#movieSlide-will').css({
            'z-index':'1000'
          });
    });
    
    
    $("#login_dialog").dialog({
              autoOpen: false,
              height: 300,
              width: 410,
              modal: true,
              show: {
                  effect: "blind",
                  duration: 1000
              },
              hide: {
                  effect: "explode",
                  duration: 1000
              },


          });

     $("#btnMainSignIn")
          .button()
          .click(function () {
              $("#login_dialog").dialog("open");
     });
	$('.field, textarea').focus(function() {
        if(this.title==this.value) {
            this.value = '';
        }
    }).blur(function(){
        if(this.value=='') {
            this.value = this.title;
        }
    });
      
    $('.flexslider').flexslider({
        animation: "fade",
        slideshow: true,
        controlNav: true,
        directionNav: false              
    });  
    $(".bg-content .bg-inner .gallery .gallery-bot .img-silde").jcarousel({
    	scroll:4,
    	auto: 0,
    	wrap: 'last',
        initCallback:secondarySlider2,
    });
    $('#movieSlide-now').jcarousel({
    	scroll: 3,
    	auto: 10,
    	wrap: 'last',
        initCallback:secondarySlider,
    });
    $('#movieSlide-will').jcarousel({
    	scroll: 3,
    	auto: 10,
    	wrap: 'last',
        initCallback:secondarySlider1,
    });
     $('#movieSlide-will ul.jcarousel-list').css({
            'width':'3000px'
     });
    $('#movieSlide-will').css({
        'z-index':'-1'
    });
   $('#div-km').jCarouselLite({
    	vertical: true,		
        hoverPause:true,		// chạy theo chiều dọc
		visible:3,					// Số bài viết cần hiện
		auto:5000,					// Tự động scroll
		speed:1000
    });
    $('.table-box1 .t5 #div-km').css({
        'height': '409px'
    });
    if ($.browser.msie && $.browser.version == 6) {
		DD_belatedPNG.fix('#wrapper, #logo a, .socials a, #search, #navigation, #navigation a, #slider, #slider img, .caption, a.watch-now, #main-top, #main-middle, #main-bottom, a.learn-more, .games-slider, .small-caption, .prev-arrow, .next-arrow, .flex-control-nav a, .shell');
	};
    $(".movie-des").hide();
    $(".bg-content #pgMovie  .img-moive").on("mouseenter", function(){
        var selectedEffect ='blind';
        var options = {};
        $(this).addClass("action");
        $(".bg-content #pgMovie  .action  .movie-des" ).show(selectedEffect, options, 800);
        return false;
    });
    
    $(".bg-content #pgMovie  .img-moive").on("mouseleave", function(){
        var selectedEffect ='blind';
        var options = {};
        $(".bg-content #pgMovie  .img-moive .movie-des" ).hide(selectedEffect, options, 600);
        $( ".bg-content #pgMovie  .img-moive" ).removeClass("action");
        return false;
   });
});
function secondarySlider(carousel) {
   $('.next-arrow').bind('click', function() {
        carousel.next();
        return false;
    });

    $('.prev-arrow').bind('click', function() {
        carousel.prev();
        return false;
    });
} 
function secondarySlider1(carousel) {
   $('.next-arrow1').bind('click', function() {
        carousel.next();
        return false;
    });

    $('.prev-arrow1').bind('click', function() {
        carousel.prev();
        return false;
    });
}
function secondarySlider2(carousel) {
   $('.img-silde .next-arrow').bind('click', function() {
        carousel.next();
        return false;
    });

    $('.img-silde .prev-arrow').bind('click', function() {
        carousel.prev();
        return false;
    });
} 